#ifndef _POLYNOMIAL_H
#define _POLYNOMIAL_H
#include "list.h"

struct Node;
typedef struct Node *PtrToNode;

typedef PtrToNode Polynomial;
typedef PtrToNode Position;
typedef struct
{
    //系数
    int Coefficient;
    //指数
    int Exponent;
} Element;
typedef Element *ElementType;

struct Node
{
    ElementType X;
    PtrToNode Next;
};

void ZeroPolynomial();

void MakeEmpty(Polynomial L);
int IsEmpty(Polynomial L);
int IsLast(Position P, Polynomial L);
Position Find(ElementType X, Polynomial L);
Position FindPrevious(ElementType X, Polynomial L);
void Insert(ElementType X, Polynomial L, Position P);
void Delete(ElementType X, Polynomial L);
void Release(Polynomial L);
#endif // !_POLYNOMIAL_H